﻿using ConfExpert.Forms.Base;
using DevTeam;
using System;

namespace ConfExpert.Forms.Depo
{
    public partial class EskiToplar : XForm
    {
        public EskiToplar()
        {
            InitializeComponent();
        }

        private void EskiToplar_Load(object sender, EventArgs e)
        {
            gridView1.SetViewCaption("Müşteri bazlı liste");
            gridView2.SetViewCaption("Artikel ve Top Detayı");
            btnGetir.ItemClick += btnGetir_ItemClick;
            btnGetir.PerformClick();
        }

        void btnGetir_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gridView1.Init("GetEskiToplar", txtYas.EditValue.ToStr());
            gridView1.AddDetailGrid(gridView2, "CustomerId");
            txtYas.EditValue = gridView1.Dataset().Tables[2].Rows[0][0].ToStr();

            gridView1.FormatAsNumber(1, "Qty");
            gridView2.FormatAsNumber(1, "Qty");
            gridView1.AddSummary("Qty");
            gridView2.AddSummary("Qty");
            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
        }
    }
}
